<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:pe="http://primefaces.org/ui/extensions">

<f:metadata>
	<f:viewParam name="module" value="#{menuMB.modulo.idmodulo}" />
	<f:event type="preRenderView" listener="#{menuMB.updateMenu()}" />
</f:metadata>


<ui:composition template="/WEB-INF/templates/defaultLayout.xhtml">

	<!-- Definiendo la cabecera de la pagina -->
	<ui:define name="title">
		<h:outputText value="COOP" />
	</ui:define>

	<!-- content -->
	<ui:define name="menu-left">
		<ui:include src="/WEB-INF/menus/cuentasMenu.xhtml" />
	</ui:define>


	<!-- Definiendo el cuerpo de la pagina -->
	<ui:define name="content">

		<div class="sf-content-cabecera">
			<h2>Buscar Socio</h2>
		</div>

		<h:form id="buscar">
			<p:growl id="growl" sticky="true" />

			<div class="sf-agrupador-content">
				<div class="sf-agrupador-content-table">
					<table>
						<tbody>
							<tr>
								<td width="50"><h:outputLabel>Buscar:</h:outputLabel></td>
								<td width="1"><p:inputText id="txtBuscarPN"
										value="#{socioBean.valorBusqueda}" size="80" required="true"
										requiredMessage="Ingrese un valor de busqueda" rendered="#{socioBean.personaNatural}">
										<p:ajax update="growl" event="keyup" />
									</p:inputText> <p:watermark
										value="Buscar por: Codigo Socio, DNI o Apellidos y Nombres"
										for="txtBuscarPN" /></td>
								<td width="1"><p:inputText id="txtBuscarPJ"
										value="#{socioBean.valorBusqueda}" size="80" required="true"
										requiredMessage="Ingrese un valor de busqueda" rendered="#{socioBean.personaJuridica}">
										<p:ajax update="growl" event="keyup" />
									</p:inputText> <p:watermark
										value="Buscar por: Codigo Socio, RUC o Razon Social"
										for="txtBuscarPJ" /></td>
								<td width="350"><p:commandButton value="buscar"
										actionListener="#{socioBean.buscarSocio()}"
										update=":panelDatos" /></td>
								
								<td width="100"><h:outputLabel>Tipo Persona:</h:outputLabel></td>
								<td><p:selectOneMenu
										value="#{socioBean.comboTipoPersona.itemSelected}">
										<f:selectItems
											value="#{socioBean.comboTipoPersona.items.entrySet()}"
											var="val" itemLabel="#{val.value}" itemValue="#{val.key}" />
										<p:ajax update=":panelDatos, :form-buttons, :buscar" listener="#{socioBean.limpiarTablas()}"></p:ajax>
									</p:selectOneMenu></td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</h:form>

		<div class="buttons">
			<h:form id="form-buttons">
				<div class="tiptip">
					<p:commandLink styleClass="button left" title="Nueva busqueda">
						<span class="icon icon3"></span>
						<span class="label">Nuevo</span>
					</p:commandLink>

					<h:link styleClass="button middle" title="Editar Socio"
						outcome="/modules/socios/mostrarDatosSocio/datosSocioPN.xhtml" target="_blank" rendered="#{socioBean.personaNatural}">
						<span class="icon icon145"></span>
						<span class="label">Editar</span>
						<f:param name="dni" value="#{socioBean.DNIoRUCTemporal}" />
					</h:link>
					
					<h:link styleClass="button middle" title="Editar Socio" 
						outcome="/modules/socios/mostrarDatosSocio/datosSocioPJ.xhtml" target="_blank" rendered="#{socioBean.personaJuridica}">
						<span class="icon icon145"></span>
						<span class="label">Editar</span>
						<f:param name="ruc" value="#{socioBean.DNIoRUCTemporal}" />
					</h:link>

					<h:commandLink action="#" styleClass="button right"
						title="Eliminar Socio">
						<span class="icon icon186"></span>
						<span class="label">Eliminar</span>
					</h:commandLink>
				</div>
				<div class="dropdown">
					<h:outputLink styleClass="button" disabled="true">
						<span class="icon icon96">&nbsp;</span>
						<span class="label">Otros</span>
						<span class="toggle">&nbsp;</span>
					</h:outputLink>
					<div class="dropdown-slider">
						<h:commandLink action="#" styleClass="ddm">
							<span class="icon icon96">&nbsp;</span>
							<span class="label">Vacaciones</span>
						</h:commandLink>
						<h:commandLink action="#" styleClass="ddm">
							<span class="icon icon96">&nbsp;</span>
							<span class="label">Mas</span>
						</h:commandLink>
						<h:commandLink action="#" styleClass="ddm">
							<span class="icon icon96">&nbsp;</span>
							<span class="label">Mas</span>
						</h:commandLink>
					</div>
					<!-- /.dropdown-slider -->
				</div>
				<!-- /.dropdown -->
			</h:form>
		</div>

		<h:panelGroup id="panelDatos">

			<!-- Buscar Persona Natural -->
			<ui:include src="/modules/socios/buscarSocio/buscarSocioPN.xhtml">
				<ui:param name="managedBean" value="#{socioBean}" />
				<ui:param name="componentName" value="buscarSocioPN" />
				<ui:param name="editarOutputDialog" value="dlgPersonaNatural" />
			</ui:include>
			<!-- end Buscar PersonaNatural -->

			<!-- Buscar Persona Juridica -->
			<ui:include src="/modules/socios/buscarSocio/buscarSocioPJ.xhtml">
				<ui:param name="managedBean" value="#{socioBean}" />
				<ui:param name="componentName" value="buscarSocioPJ" />
				<ui:param name="editarOutputDialog" value="dlgPersonaJuridica" />
			</ui:include>
			<!-- end Buscar Persona Juridica -->
			
		</h:panelGroup>

	</ui:define>
</ui:composition>
</html>
